/*
 * @Author: lvgrape lvgrape@outlook.com
 * @Date: 2024-06-21 11:14:24
 * @LastEditors: LVGRAPE
 * @LastEditTime: 2024-07-02 15:15:12
 * @FilePath: \zino_premium_rt\ZINO\imu\imu.h
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
#ifndef __ZINO_IMU_H_
#define __ZINO_IMU_H_
#ifdef __cplusplus
extern "C"
{
#endif // __cplusplus

#include <stdint.h>
#include <stdbool.h>

typedef struct zino_imu_s
    {
        union
        {
            int16_t raw[3];
            struct
            {
                // absolute angle inclination in multiple of 0.1 degree    180 deg = 1800
                int16_t roll;
                int16_t pitch;
                int16_t yaw;
            };
        }attitudes;
        float q0;
        float q1;
        float q2;
        float q3;
        float rMat[3][3];
        float ki;
        float kp;
        float integralFBx;
        float integralFBy;
        float integralFBz;
        bool (*isAccHealthy)(void);
        bool (*isGyroHealthy)(void);
        bool (*isMagHealthy)(void);
        // bool (*init)(void);
        // bool (*update)(void);
        bool useMag;
        bool useAcc;
        bool useGyro;

    } zino_imu_t;

#ifdef __cplusplus
}
#endif // __cplusplus
#endif
